<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <meta http-equiv="X-UA-Compatible" content="IE=edge" >
  <title>无痕岁月</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description">
<meta property="og:type" content="website">
<meta property="og:title" content="无痕岁月">
<meta property="og:url" content="http://chenggang.win/index.html">
<meta property="og:site_name" content="无痕岁月">
<meta property="og:description">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="无痕岁月">
<meta name="twitter:description">
  
  
    <link rel="icon" href="/favicon.ico">
  
  <link rel="stylesheet" href="/css/style.css">
</head>

<body>
  <div id="container">
    <div class="left-col">
    <div class="overlay"></div>
<div class="intrude-less">
	<header id="header" class="inner">
		<a href="/" class="profilepic">
			
			<img lazy-src="/img/avatar.jpg" class="js-avatar">
			
		</a>

		<hgroup>
		  <h1 class="header-author"><a href="/">Heng</a></h1>
		</hgroup>

		

		
			<div class="switch-btn">
				<div class="icon">
					<div class="icon-ctn">
						<div class="icon-wrap icon-house" data-idx="0">
							<div class="birdhouse"></div>
							<div class="birdhouse_holes"></div>
						</div>
						<div class="icon-wrap icon-ribbon hide" data-idx="1">
							<div class="ribbon"></div>
						</div>
						
						
						<div class="icon-wrap icon-me hide" data-idx="3">
							<div class="user"></div>
							<div class="shoulder"></div>
						</div>
						
					</div>
					
				</div>
				<div class="tips-box hide">
					<div class="tips-arrow"></div>
					<ul class="tips-inner">
						<li>菜单</li>
						<li>标签</li>
						
						
						<li>关于我</li>
						
					</ul>
				</div>
			</div>
		

		<div class="switch-area">
			<div class="switch-wrap">
				<section class="switch-part switch-part1">
					<nav class="header-menu">
						<ul>
						
							<li><a href="/">主页</a></li>
				        
							<li><a href="/tags/随笔">随笔</a></li>
				        
							<li><a href="/archives">所有文章</a></li>
				        
						</ul>
					</nav>
					<nav class="header-nav">
						<div class="social">
							
								<a class="github" target="_blank" href="https://github.com/heng1025/heng1025.github.io" title="github">github</a>
					        
								<a class="mail" target="_blank" href="/895176750@qq.com" title="mail">mail</a>
					        
						</div>
					</nav>
				</section>
				
				
				<section class="switch-part switch-part2">
					<div class="widget tagcloud" id="js-tagcloud">
						<a href="/tags/angular-双向绑定-MVC-MVVM/" style="font-size: 10px;">angular 双向绑定 MVC MVVM</a> <a href="/tags/node-javascript-v8-CLI/" style="font-size: 10px;">node javascript v8 CLI</a>
					</div>
				</section>
				
				
				

				
				
				<section class="switch-part switch-part3">
				
					<div id="js-aboutme">http://index.html</div>
				</section>
				
			</div>
		</div>
	</header>				
</div>

    </div>
    <div class="mid-col">
      <nav id="mobile-nav">
  	<div class="overlay">
  		<div class="slider-trigger"></div>
  		<h1 class="header-author js-mobile-header hide">Heng</h1>
  	</div>
	<div class="intrude-less">
		<header id="header" class="inner">
			<div class="profilepic">
			
				<img lazy-src="/img/avatar.jpg" class="js-avatar">
			
			</div>
			<hgroup>
			  <h1 class="header-author">Heng</h1>
			</hgroup>
			
			<nav class="header-menu">
				<ul>
				
					<li><a href="/">主页</a></li>
		        
					<li><a href="/tags/随笔">随笔</a></li>
		        
					<li><a href="/archives">所有文章</a></li>
		        
		        <div class="clearfix"></div>
				</ul>
			</nav>
			<nav class="header-nav">
				<div class="social">
					
						<a class="github" target="_blank" href="https://github.com/heng1025/heng1025.github.io" title="github">github</a>
			        
						<a class="mail" target="_blank" href="/895176750@qq.com" title="mail">mail</a>
			        
				</div>
			</nav>
		</header>				
	</div>
</nav>

      <div class="body-wrap">
  
    <article id="post-angular基础" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2015/04/20/angular基础/" class="article-date">
  	<time datetime="2015-04-20T03:11:39.000Z" itemprop="datePublished">2015-04-20</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2015/04/20/angular基础/">angular基础</a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="angular基础入门"><a href="#angular基础入门" class="headerlink" title="angular基础入门"></a>angular基础入门</h2><ol>
<li>背景<ul>
<li>angularJS 是Misko Hevery 等人创建，在2009年时被谷歌收购，由一个全职团队维护；</li>
<li>angularJS 可以轻松构建SPA 页面，通过指令扩展了HTML，可以实现数据的双向绑定；</li>
<li>MVC MVVM 模块化 指定系统 数据双向绑定；</li>
</ul>
</li>
<li><p>起步 </p>
<ul>
<li>下载 Angular.js 的包 <code>npm install angular</code> 或 <code>bower install angular</code>，然后在页面中进行引用。</li>
<li>永远的Hello World,在输入框中输入 Hello world会显示出来，这里也实现了双向绑定<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">&lt;div ng-app&gt;</span><br><span class="line">  &lt;input type=&quot;text&quot; ng-model=&#123;&#123;name&#125;&#125;&gt;</span><br><span class="line">  &lt;p&gt;&#123;&#123;name&#125;&#125;&lt;/p&gt;</span><br><span class="line">&lt;/div&gt;</span><br></pre></td></tr></table></figure>
</li>
</ul>
</li>
<li><p>简单说明</p>
<ul>
<li><code>ng-app</code>是一个入口指令，用来管理页面中的元素</li>
<li><code>ng-model={name}</code> 是把文本框的值绑定在name上，当文本框的值发生改变时，而 也会相应的改变，即双向绑定； </li>
</ul>
</li>
</ol>

      
    </div>
    
    <div class="article-info article-info-index">
      
      
	<div class="article-tag tagcloud">
		<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/angular-双向绑定-MVC-MVVM/">angular 双向绑定 MVC MVVM</a></li></ul>
	</div>

      

      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>









  
    <article id="post-node基础" class="article article-type-post" itemscope itemprop="blogPost">
  
    <div class="article-meta">
      <a href="/2015/04/19/node基础/" class="article-date">
  	<time datetime="2015-04-19T12:20:42.000Z" itemprop="datePublished">2015-04-19</time>
</a>
    </div>
  
  <div class="article-inner">
    
      <input type="hidden" class="isFancy" />
    
    
      <header class="article-header">
        
  
    <h1 itemprop="name">
      <a class="article-title" href="/2015/04/19/node基础/">node基础</a>
    </h1>
  

      </header>
      
    
    <div class="article-entry" itemprop="articleBody">
      
        <h2 id="node-js的基础知识"><a href="#node-js的基础知识" class="headerlink" title="node.js的基础知识"></a>node.js的基础知识</h2><ol>
<li><strong>node.js的简介</strong><br>Node.js是一个基于<strong>Chrome</strong> JavaScript运行时建立的平台，用于方便地搭建响应速度快、易于扩展的网络应用。<br>Node.js 使用<strong>事件驱动</strong>， <strong>非阻塞I/O</strong> 模型而得以<strong>轻量</strong>和<strong>高效</strong>，非常适合在分布式设备上运行的数据密集型的实时应用。</li>
<li><strong>node.js的版本说明</strong><br>node.js目前有两个版本 一个是长期支持版,目前最新版本是的<strong>4.4.2</strong>；另一个是稳定版，最新版本是<strong>5.10.0</strong>。</li>
<li><strong>node.jsd开发环境配置</strong></li>
</ol>
<ul>
<li>在进行node开发之前必须配置node的开发环境，首先在node.js的官网上下载node.js的安装包，下载地址<code>https://nodejs.org/en/</code>.安装后，node.js会默认添加到<strong>环境变量</strong>。安装完成之后在控制台下输入<code>node -v</code>会得到以下结果。<br><strong> v4.4.0 </strong></li>
<li>当我们安装完后node后，node自带一个包管理工具<strong>npm</strong>,node package  manager(node.js的包管理工具)。npm的官网<code>https://www.npmjs.com/</code>.npm是全球最大的开源库系统。</li>
<li>由于node.js的版本更新比较快，变化也比较大，node.js的官方也考虑到了这一点，故当我们安装好了之后，我们可以在npm的官网上下载一个模块<strong>nvm</strong>,它是专门用来管理node.js的版本。<ul>
<li>nvm的使用说明：所有的操作均在操作系统的控制台下进行。<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">nvm ls                 用来查看node.js版本列表</span><br><span class="line">nvm use node的版本号   用来切换node的版本</span><br></pre></td></tr></table></figure>
</li>
</ul>
</li>
</ul>
<p><strong>总结</strong></p>
<ul>
<li>在正式学习node之前必须配置好node的环境，以致于在后续的学习中能够专注于自己的代码。</li>
<li>在学习之前务必搞清楚node ，npm, nvm 是什么，怎么用，最有效的方式就是查看它们的官网。</li>
</ul>

      
    </div>
    
    <div class="article-info article-info-index">
      
      
	<div class="article-tag tagcloud">
		<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/node-javascript-v8-CLI/">node javascript v8 CLI</a></li></ul>
	</div>

      

      
      <div class="clearfix"></div>
    </div>
    
  </div>
  
</article>









  
  
</div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info">
    	<div class="footer-left">
    		&copy; 2016 Heng
    	</div>
      	<div class="footer-right">
      		<a href="http://hexo.io/" target="_blank">Hexo</a>  Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
      	</div>
    </div>
  </div>
</footer>
    </div>
    
  <link rel="stylesheet" href="/fancybox/jquery.fancybox.css">


<script>
	var yiliaConfig = {
		fancybox: true,
		mathjax: true,
		animate: true,
		isHome: true,
		isPost: false,
		isArchive: false,
		isTag: false,
		isCategory: false,
		open_in_new: false
	}
</script>
<script src="http://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js"></script>
<script src="/js/main.js"></script>






<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    }
});

MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';                 
    }       
});
</script>

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>


  </div>
</body>
</html>